package com.qjs.service.impl;

import java.util.List;
import java.util.Map;

import com.qjs.dao.BaseDao;
import com.qjs.service.IBaseService;

public abstract class baseServiceImpl <T> implements IBaseService<T> {
	public abstract BaseDao<T> getBaseDao();

	public T insert(T record) throws Exception {
		getBaseDao().insert(record);
		return record;
	}
	
	public int insertArray(List<T> records) throws Exception {
		return getBaseDao().insertArray(records);
	}

	public int deleteById(Long id) throws Exception {
		return getBaseDao().deleteById(id);
	}

	public int deleteBy(T record) throws Exception {
		return getBaseDao().deleteBy(record);
	}

	public int updateBy(T record) throws Exception {
		return getBaseDao().updateBy(record);
	}
	
	public int updateArray(List<T> records) throws Exception {
		return getBaseDao().updateArray(records);
	}

	public Integer getCount(Map<String, Object> paramsMap) throws Exception {
		return getBaseDao().getCount(paramsMap);
	}

	public T getById(Long id) throws Exception {
		return getBaseDao().getById(id);
	}

	public List<T> queryBy(T record) throws Exception {
		return getBaseDao().queryBy(record);
	}
	
	public List<Map<String, Object>> search(String str) throws Exception {
		return getBaseDao().search(str);
	}
	
	public List<Map<String, Object>> search(String[] str) throws Exception {
		return getBaseDao().search(str);
	}
	
	public List<Map<String, Object>> search(Map<String, Object> strMap) throws Exception {
		return getBaseDao().search(strMap);
	}
	
	public List<Map<String, Object>> search2(Map<String, Object> strMap) throws Exception {
		return getBaseDao().search2(strMap);
	}
	
	public List<Map<String, Object>> queryBy2(Map<String, Object> strMap) throws Exception {
		return getBaseDao().queryBy2(strMap);
	}
	
	public List<Map<String, Object>> queryBy3(Map<String, Object> strMap) throws Exception {
		return getBaseDao().queryBy3(strMap);
	}
	public List<Map<String, Object>> search3(Map<String, Object> strMap) throws Exception {
		return getBaseDao().search3(strMap);
	}
}
